package com.app.lan;

import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;

public class Streamer {
	private ArrayList<ObjectOutputStream> clientOutputStream;
	private ObjectOutputStream serverOutputStream;
	private ArrayList<ObjectInputStream> clientInputStream;
	private ObjectInputStream serverInputStream;
	
	private Streamer(){
		
		clientInputStream = new ArrayList<ObjectInputStream>();
		clientOutputStream = new ArrayList<ObjectOutputStream>();
	};
	private volatile static Streamer streamer;
	
	public static Streamer getInstance(){
		if(streamer == null){
			synchronized(Streamer.class){
				if(streamer==null){
					streamer = new Streamer();
				}
			}
		}
		return streamer;
	}

	public ArrayList<ObjectOutputStream> getClientOutputStream() {
		return clientOutputStream;
	}

	public void setClientOutputStream(ArrayList<ObjectOutputStream> clientOutputStream) {
		this.clientOutputStream = clientOutputStream;
	}
	
	public void addClientOutputStream(ObjectOutputStream clientOutputSream){
		this.clientOutputStream.add(clientOutputSream);
	}

	public ObjectOutputStream getServerOutputStream() {
		return serverOutputStream;
	}

	public void setServerOutputStream(ObjectOutputStream serverOutputStream) {
		this.serverOutputStream = serverOutputStream;
	}

	public ArrayList<ObjectInputStream> getClientInputStream() {
		return clientInputStream;
	}

	public void setClientInputStream(ArrayList<ObjectInputStream> clientInputStream) {
		this.clientInputStream = clientInputStream;
	}

	public void addClientInputStream(ObjectInputStream clientInputSream){
		this.clientInputStream.add(clientInputSream);
	}
	public ObjectInputStream getServerInputStream() {
		return serverInputStream;
	}

	public void setServerInputStream(ObjectInputStream serverInputStream) {
		this.serverInputStream = serverInputStream;
	}
	

	
	
}
